package gtkwire.widget;

import gtkwire.*;

/**
*Base class for box containers.
*/
public abstract class GtkBox extends GtkContainer
{

	protected GtkBox()
        {
		super();
        }

        protected GtkBox( String name, GladeKey key )
        {
		super( name, key );
        }

	/**
	*Adds widget with reference to the start of box. The child is packed after any other child packed with reference to the start of box.
	*/
	public void packStart( GtkWidget child, boolean expand, boolean fill, int padding )
	{
		String[] msg = new String[ 4 ];
		msg[0] = child.getName();
		msg[1] = Boolean.toString(expand);
		msg[2] = Boolean.toString(fill);
		msg[3] = Integer.toString(padding);
		app().sendCommand( name, GTKWireCommand.PACK_START, msg );
	}

	/**
	*Adds widget with reference to the end of box and default padding, true, true, 0 for expand, fill and padding.
	*The child is packed after any other child packed with reference to the start of box.
	*/
	public void packStart( GtkWidget child )
	{
		packStart( child, true, true, 0 );
	}

	/**
	*Adds widget with reference to the end of box. The child is packed after (away from end of) 
	*any other child packed with reference to the end of box.
	*/
	public void packEnd( GtkWidget child, boolean expand, boolean fill, int padding )
	{
		String[] msg = new String[ 4 ];
		msg[0] = child.getName();
		msg[1] = Boolean.toString(expand);
		msg[2] = Boolean.toString(fill);
		msg[3] = Integer.toString(padding);
		app().sendCommand( name, GTKWireCommand.PACK_END, msg );
	}

	/**
	*Adds widget with reference to the end of box and default padding, true, true, 0 for expand, fill and padding.
	*The child is packed after (away from end of) any other child packed with reference to the end of box.
	*/
	public void packEnd( GtkWidget child  )
	{
		packEnd( child, true, true, 0 );
	}

	/**
	*Sets all children of box to be given equal space.
	*/
	public void setHomogenous( boolean b )
	{
		app().sendCommand( name, GTKWireCommand.SET_HOMOGENOUS, b );
	}
	
	/**
	*Sets number of pixels between children.
	*/
	public void setSpacing( int i )
	{
		app().sendCommand( name, GTKWireCommand.SET_SPACING, i );
	}

}//end class